#ifndef _cesium_random_sampler_hpp_
#define _cesium_random_sampler_hpp_

#include "cesium/buffer.hpp"

namespace Cesium {

/** A sampler which selects samples uniformly at random. */
template<typename RNGType>
class RandomSampler {
public:
    RandomSampler(float frac)
     : rng(), fraction(frac)
    {
        assert(fraction >= 0.0 && fraction <= 1.0);
    }

    RandomSampler(const RNGType& _rng, float frac)
     : rng(_rng), fraction(frac)
    {
        assert(fraction >= 0.0 && fraction <= 1.0);
    }

    bool sample(Buffer* data, BufferRange range) {
        return ( rng.random() < fraction );
    }
private:
    RNGType rng;
    float fraction;
}; // class RandomSampler

} // namespace Cesium

#endif //_cesium_random_sampler_hpp_
